<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';

$zbp->Load();
$action='root';
if (!$zbp->CheckRights($action)) {$zbp->ShowError(6);die();}
if (!$zbp->CheckPlugin('Xd_ad_Article')) {$zbp->ShowError(48);die();}

$blogtitle='文章页广告 配置';
$act = "";
if ($_GET['act']){
$act = $_GET['act'] == "" ? 'config' : $_GET['act'];
}

require $blogpath . 'zb_system/admin/admin_header.php';
require $blogpath . 'zb_system/admin/admin_top.php';
?>
<link rel="stylesheet" href="./source/setting.css">
<style type="text/css">.left{display:block; }
.tusername span.ok { background:#004c98; }
.tusername span.not { background:#bbb; }
.tmenu { width:100%; height:40px; line-height:39px; border-top:1px solid #efefef; border-bottom:1px solid #004c98; }
.tmenu li { display:inline-block; vertical-align:top; }
.tmenu li a { padding:0 25px; font-size:16px; color:#333; display:block; }
.tmenu li a:hover { color:#fff; background:#004c98; }
.tmenu li a.on { color:#fff; background:#004c98; }
</style>
<script type="text/javascript" src="./source/setting.js"></script>
<script src="source/jscolor.js" type="text/javascript"></script>
<div class="twrapper">
  <div class="theader">
		<div class="tusername"><span class=ok><?php echo $blogtitle;?></span></div>
    <div class="tmenu">
      <ul>
        <?php Xd_ad_Article_SubMenu($act);?><li><a href="<?php echo $zbp->host;?>zb_users/plugin/AppCentre/main.php?id=1721" title="插件升级版：添加文章页广告分类与文章ID排除，并添加独立文章评论广告，广告CSS样式定义等。" >插件升级版</a></li> 
      </ul>
    </div>
  </div>
  <div class="tmain">
    <?php
if ($act == 'jbsz'){
if(isset($_POST['adweizhi'])){
 if (function_exists('CheckIsRefererValid')) CheckIsRefererValid();
	$zbp->Config('Xd_ad_Article')->adweizhi = $_POST['adweizhi'];
	$zbp->Config('Xd_ad_Article')->adweizhixz = $_POST['adweizhixz'];
	$zbp->SaveConfig('Xd_ad_Article');
	$zbp->ShowHint('good');
}
?>
    <form name="seo" method="post" class="setting">
	 <?php if (function_exists('CheckIsRefererValid')) {echo '<input type="hidden" name="csrfToken" value="' . $zbp->GetCSRFToken() . '">';}?>
      <dl>
        <dt>文章页广告配置</dt>
		
		<dd class="half"  style="width:100%">
			<label for="adweizhixz">广告位置选择</label>
			<select name="adweizhixz" id="adweizhixz">
				<option value="d"<?php if($zbp->Config('Xd_ad_Article')->adweizhixz=='d'){echo 'selected="selected"';}?>>不显示广告</option>
				<option value="a"<?php if($zbp->Config('Xd_ad_Article')->adweizhixz=='a'){echo 'selected="selected"';}?>>开头显示</option>
				<option value="b"<?php if($zbp->Config('Xd_ad_Article')->adweizhixz=='b'){echo 'selected="selected"';}?>>末尾显示</option>
				<option value="c"<?php if($zbp->Config('Xd_ad_Article')->adweizhixz=='c'){echo 'selected="selected"';}?>>文章中显示</option>
			</select>
          <i class="warn">></i><span class="warncon">广告位置选择，分开头显示、末尾显示和文章中显示三种选择；</span><i class="warnb">|</i></dd>
		<dd style="width:100%">
          <label>文章中显示</label>
          <input type="text" id="adweizhi" name="adweizhi"  value="<?php echo $zbp->Config('Xd_ad_Article')->adweizhi;?>" />在文章某段后显示；请输入数字，广告则在对应文章的”数值“段落之后显示；
          <i class="warn">></i><span class="warncon">广告在文章某段后显示；请输入数字，广告则在对应文章段落的”数值“段落后显示；</span><i class="warnb">|</i></dd>
        <dd class="setok">
          <input name="submit" type="submit" class="setbtn" value="保存设置" />
          <img id="statloading" src="source/loading.gif" alt="" /></dd>
      </dl>
    </form>
    </dl>
    <?php
}
?>
  </div>
</div>
<script type="text/javascript">ActiveTopMenu("topmenu_Xd_ad_Article");</script>
<?php
require $blogpath . 'zb_system/admin/admin_footer.php';
RunTime();
?>